#ifndef USER_H
#define USER_H
//  File:         User.h
//  Author:       Scott Nordmann & Lauren Wallace
//  Description:  A class definition for the User.

#include "Notebook.h"
#include "Calendar.h"
#include "ToDoList.h"
#include "Inbox.h"
#include "TagCollection.h"

#include "Entry.h"
#include "Note.h"
#include "Event.h"
#include "Task.h"
#include "Tag.h"

#include <string>
#include <vector>
#include <fstream>


class User 
{
public:
	User();
	User(const std::string& u, const std::string& pwd, std::ifstream& ifsave);
	~User();
	void shutDown(std::ofstream& ofsave);
	void populateTagCollection(std::ifstream& ifsave);

	std::string getUsername() const;
	std::string getPassword() const;

	void display()const;
	void populate();

	void setUsername(const std::string& u);
	void setPassword(const std::string& p);


	void viewNotebook();
	void viewCalendar();
	void viewToDoList();
	void viewByTag();

	void createNote();
	void createEvent();
	void createTask();
	void createTag();

	void editEvent();

	void deleteEvent();
	
	void sendMail();
	void checkMail();

	std::vector<Entry*>* getSentMail();
	std::vector<Entry*>* getInbox();
	
	bool operator==(const User& u) const;
	bool operator!=(const User& u) const;
	bool operator<(const User& u) const;
	bool operator>(const User& u) const;

private:
	std::string username;
	std::string password;

	Notebook* notebook;
	Calendar* calendar;
	ToDoList* toDoList;
	Inbox* inbox;
	TagCollection* tagCollection;
};

inline std::string User::getUsername() const { return username; }
inline std::string User::getPassword() const { return password; }
inline void User::setUsername(const std::string& u) { username = u; }
inline void User::setPassword(const std::string& p) { password = p; }

inline bool User::operator==(const User& u) const
{
	return (getUsername() == u.getUsername());
}

inline bool User::operator!=(const User& u) const
{
	return !(*this == u);
}

inline bool User::operator<(const User& u) const
{
	return (getUsername() < u.getUsername());
}

inline bool User::operator>(const User& u) const
{
	return !(*this < u || *this == u);
}


#endif